class Solution {
public:
    int FirstNotRepeatingChar(string str) {
        int i = 0;
        for (i = 0; i < str.size(); i++) {
            int j = 0;
            int flag = 1;
            for (j = 0; j < str.size(); j++) {
                if (str[i] == str[j] && i != j) {
                    flag = 0;
                }
            }
            if (flag == 1)
                return i;
        }
        return -1;
    }
};